package com.jackyzgy.test.thread;

public class ThreadYield extends Thread
{
    public void run(){
        for(int a=0;a<50;a++){
            yield();
            System.out.println(Thread.currentThread().getName()+" : "+a);
        }
    }
    public static void main(String[] args) 
    {
        ThreadYield t1 = new ThreadYield();
        ThreadYield t2 = new ThreadYield();
        t1.start();
        t2.start();
    }
}